package com.cxj.link.vo;

import android.content.Context;
import com.cxj.link.util.LogUtil;

public class GameConfig {
    public static int DEFAULT_TIME = 0;
    public static final int PIECE_HEIGHT = 34;
    public static final int PIECE_WIDTH = 31;
    private int beginImageX;
    private int beginImageY;
    private Context context;
    private int gameTime;
    private int xSize;
    private int ySize;

    public GameConfig(int xSize, int ySize, int width, int height, int gameTime, Context context) {
        this.xSize = xSize;
        this.ySize = ySize;
        this.gameTime = gameTime;
        this.context = context;
        this.beginImageX = getCenterX(width, xSize);
        this.beginImageY = getCenterY(height, ySize);
        LogUtil.info("beginImageX:" + this.beginImageX + " width:" + width + " :" + xSize * 31);
    }

    private int getCenterX(int width, int xSize) {
        return (width - xSize * 31) / 2;
    }

    private int getCenterY(int height, int ySize) {
        return (height - ySize * 34 - 70) / 2;
    }

    public int getBeginImageX() {
        return this.beginImageX;
    }

    public int getBeginImageY() {
        return this.beginImageY;
    }

    public Context getContext() {
        return this.context;
    }

    public int getGameTime() {
        return this.gameTime;
    }

    public int getXSize() {
        return this.xSize;
    }

    public int getYSize() {
        return this.ySize;
    }

    @Override
    public String toString() {
        return "GameConf [beginImageX=" + this.beginImageX + ", beginImageY=" + this.beginImageY + ", context="
                + this.context + ", gameTime=" + this.gameTime + ", xSize=" + this.xSize + ", ySize=" + this.ySize
                + "]";
    }
}